// 命名空间
var chat = {};
/**
 * 表情测试开关
 * @type {boolean}
 */
chat.collectFeesEmojiTest = true;
// 所有代码
chat.path = 'modules/main/chat/';
chat.srcPath= chat.path + 'src/';
chat.src = [
    chat.srcPath + 'EmojiUtil.js',
    chat.srcPath + 'MicLayer.js',
    chat.srcPath + 'PlayerInfoInGameWindow.js',
    chat.srcPath + 'ChatWindow.js',
    chat.srcPath + 'BuyEmojiWindow.js',
];

// 所有资源
chat.resPath= chat.path + 'res/';
chat.res = {
    PlayerInfoInGameWindow_json : chat.resPath + 'PlayerInfoInGameWindow.json',
    ChatWindow_json : chat.resPath + 'ChatWindow.json',
    AnimMicNode_json : chat.resPath + 'AnimMicNode.json',
    BuyTishi_json : chat.resPath + 'BuyTishi.json',
    ChatErrorNode_json : chat.resPath + 'ChatErrorNode.json',
    ChatNotSendNode_json : chat.resPath + 'ChatNotSendNode.json',
    ChatSpeaker_json : chat.resPath + 'ChatSpeaker.json',
    voice_cancel: chat.resPath + 'chatMic/voice_cancel.png',

    emoji_plist: chat.resPath + 'emoji.plist',
    emoji_png: chat.resPath + 'emoji.png',
    /**
     * 互动表情图标
     */
    icon_expression1: chat.resPath + "icon/emoji_xiao.png",
    icon_expression2: chat.resPath + "icon/emoji_ku.png",
    icon_expression3: chat.resPath + "icon/emoji_nu.png",
    icon_expression4: chat.resPath + "icon/expression.button4.png",
    icon_expression5: chat.resPath + "icon/expression.button5.png",
    icon_expression6: chat.resPath + "icon/expression.button6.png",
    icon_expression7: chat.resPath + "icon/expression.button7.png",
    icon_expression8: chat.resPath + "icon/expression.button8.png",
    icon_expression9: chat.resPath + "icon/expression.button9.png",
    icon_expression10: chat.resPath + "icon/emoji_shaoxiang.png",
    icon_expression11: chat.resPath + "icon/emoji_xishou.png",
    icon_zan:chat.resPath + "icon/emoji_good.png",
    icon_egg:chat.resPath + "icon/emoji_egg.png",
    icon_bomb:chat.resPath + "icon/emoji_bomb.png",
    icon_flower:chat.resPath + "icon/emoji_flower.png",
    icon_shoe:chat.resPath + "icon/emoji_shoe.png",

    icon_jiatelin:chat.resPath + "icon/emoji_jiatelin.png",
    icon_maobi:chat.resPath + "icon/emoji_maobi.png",
    icon_gongjian:chat.resPath + "icon/emoji_gongjian.png",
    icon_zhayao:chat.resPath + "icon/emoji_zhayao.png",
    icon_dapao:chat.resPath + "icon/emoji_dapao.png",
    icon_che:chat.resPath + "icon/emoji_che.png",

    icon_ship:chat.resPath + "icon/emoji_ship.png",
    icon_plane:chat.resPath + "icon/emoji_plane.png",
    icon_tiaoxing:chat.resPath + "icon/emoji_motou.png",
    icon_bingtong:chat.resPath + "icon/emoji_bingtong.png",

    icon_chuizhuozi:chat.resPath + "icon/emoji_chuizhuozi.png",
    icon_qifu:chat.resPath + "icon/emoji_qifu.png",
    icon_caishen:chat.resPath + "icon/emoji_caishen.png",

    icon_shaoxiang:chat.resPath + "icon/emoji_shaoxiang.png",
    icon_allmoneygomyhome:chat.resPath + "icon/emoji_allmoneygomyhome.png",
    /**
     * 奇迹表情
     */
    icon_daoshui:chat.resPath + "icon/emoji_daoshui.png",
    icon_pengbei:chat.resPath + "icon/emoji_pengbei.png",
    icon_woshou:chat.resPath + "icon/emoji_woshou.png",
    icon_xianbing:chat.resPath + "icon/emoji_xianbing.png",
    icon_zhuaji:chat.resPath + "icon/emoji_zhuaji.png",
    /**
     * 表情动画
     */
    expression1: chat.resPath + "expressions/expression01.json",
    expression2: chat.resPath + "expressions/expression02.json",
    expression3: chat.resPath + "expressions/expression03.json",
    expression4: chat.resPath + "expressions/expression04.json",
    expression5: chat.resPath + "expressions/expression05.json",
    expression6: chat.resPath + "expressions/expression06.json",
    expression7: chat.resPath + "expressions/expression07.json",
    expression8: chat.resPath + "expressions/expression08.json",
    expression9: chat.resPath + "expressions/expression09.json",
    expression10: chat.resPath + "expressions/expression10.json",
    expression11: chat.resPath + "expressions/expression11.json",

    effect_emoji_zan_1: chat.resPath + "prop/MJ_zan01.json",
    effect_emoji_zan_2: chat.resPath + "prop/MJ_zan02.json",
    effect_emoji_zan_3: chat.resPath + "prop/MJ_zan03.json",

    effect_emoji_egg_1: chat.resPath + "prop/MJ_egg01.json",
    effect_emoji_egg_2: chat.resPath + "prop/MJ_egg02.json",
    effect_emoji_egg_3: chat.resPath + "prop/MJ_egg03.json",

    effect_emoji_bomb_1: chat.resPath + "prop/MJ_bomb01.json",
    effect_emoji_bomb_2: chat.resPath + "prop/MJ_bomb02.json",
    effect_emoji_bomb_3: chat.resPath + "prop/MJ_bomb03.json",

    effect_emoji_flower_1: chat.resPath + "prop/MJ_flower01.json",
    effect_emoji_flower_2: chat.resPath + "prop/MJ_flower02.json",
    effect_emoji_flower_3: chat.resPath + "prop/MJ_flower03.json",

    effect_emoji_shoe_1: chat.resPath + "prop/MJ_shoe01.json",
    effect_emoji_shoe_2: chat.resPath + "prop/MJ_shoe02.json",
    effect_emoji_shoe_3: chat.resPath + "prop/MJ_shoe03.json",

    jiatelin_qiang_json: chat.resPath + "jiatelin/jiatelin_qiang.json",
    jiatelin_bullet: chat.resPath + "jiatelin/jiatelin_zidan.png",
    jiatelin_Dankong: chat.resPath + "jiatelin/jiatelin_dankong.png",

    sp_gongjian_json: chat.resPath + "sp/daoju_gongjian/daoju_gongjian.json",
    sp_gongjian_atlas: chat.resPath + "sp/daoju_gongjian/daoju_gongjian.atlas",
    sp_gongjian_png: chat.resPath + "sp/daoju_gongjian/daoju_gongjian.png",

    sp_zhayao_json: chat.resPath + "sp/daoju_zhayao/daoju_zhayao.json",
    sp_zhayao_atlas: chat.resPath + "sp/daoju_zhayao/daoju_zhayao.atlas",
    sp_zhayao_png: chat.resPath + "sp/daoju_zhayao/daoju_zhayao.png",

    sp_dapao_json: chat.resPath + "sp/daoju_dapao/daoju_dapao.json",
    sp_dapao_atlas: chat.resPath + "sp/daoju_dapao/daoju_dapao.atlas",
    sp_dapao_png: chat.resPath + "sp/daoju_dapao/daoju_dapao.png",
    sp_baodan_image: chat.resPath + 'sp/daoju_dapao/paodan.png',

    sp_chuizhuozi_json: chat.resPath + "sp/chuizhuozi/daoju_chuizhuozi.json",
    sp_chuizhuozi_atlas: chat.resPath + "sp/chuizhuozi/daoju_chuizhuozi.atlas",
    sp_chuizhuozi_png: chat.resPath + "sp/chuizhuozi/daoju_chuizhuozi.png",

    sp_bingtong_json: chat.resPath + "sp/bingtong/daoju_bingtong.json",
    sp_bingtong_atlas: chat.resPath + "sp/bingtong/daoju_bingtong.atlas",
    sp_bingtong_png: chat.resPath + "sp/bingtong/daoju_bingtong.png",

    sp_che_json: chat.resPath + "sp/che/che.json",
    sp_che_atlas: chat.resPath + "sp/che/che.atlas",
    sp_che_png: chat.resPath + "sp/che/che.png",

    sp_plane_json: chat.resPath + "sp/plane/daoju_plane.json",
    sp_plane_atlas: chat.resPath + "sp/plane/daoju_plane.atlas",
    sp_plane_png: chat.resPath + "sp/plane/daoju_plane.png",

    sp_ship_json: chat.resPath + "sp/ship/daoju_ship.json",
    sp_ship_atlas: chat.resPath + "sp/ship/daoju_ship.atlas",
    sp_ship_png: chat.resPath + "sp/ship/daoju_ship.png",

    sp_tiaoxing_png: chat.resPath + "sp/biaoqing_tiaoxing/biaoqing_tiaoxing.png",
    sp_tiaoxing_json: chat.resPath + "sp/biaoqing_tiaoxing/biaoqing_tiaoxing.json",
    sp_tiaoxing_atlas: chat.resPath + "sp/biaoqing_tiaoxing/biaoqing_tiaoxing.atlas",
    /**
    //  * 麻将聊天框表情
    //  */
    // sp_biaoqing_BYEBYE_json: chat.resPath + 'biaoqing/biaoqing_BYEBYE/biaoqing_BYEBYE.json',
    // sp_biaoqing_BYEBYE_atlas: chat.resPath + 'biaoqing/biaoqing_BYEBYE/biaoqing_BYEBYE.atlas',
    // sp_biaoqing_BYEBYE_png: chat.resPath + 'biaoqing/biaoqing_BYEBYE/biaoqing_BYEBYE.png',
    //
    // sp_biaoqing_cuicu_json: chat.resPath + 'biaoqing/biaoqing_cuicu/biaoqing_cuicu.json',
    // sp_biaoqing_cuicu_atlas: chat.resPath + 'biaoqing/biaoqing_cuicu/biaoqing_cuicu.atlas',
    // sp_biaoqing_cuicu_png: chat.resPath + 'biaoqing/biaoqing_cuicu/biaoqing_cuicu.png',
    //
    // sp_biaoqing_kaixin_json: chat.resPath + 'biaoqing/biaoqing_kaixin/biaoqing_kaixin.json',
    // sp_biaoqing_kaixin_atlas: chat.resPath + 'biaoqing/biaoqing_kaixin/biaoqing_kaixin.atlas',
    // sp_biaoqing_kaixin_png: chat.resPath + 'biaoqing/biaoqing_kaixin/biaoqing_kaixin.png',
    //
    // sp_biaoqing_kuqi_json: chat.resPath + 'biaoqing/biaoqing_kuqi/biaoqing_kuqi.json',
    // sp_biaoqing_kuqi_atlas: chat.resPath + 'biaoqing/biaoqing_kuqi/biaoqing_kuqi.atlas',
    // sp_biaoqing_kuqi_png: chat.resPath + 'biaoqing/biaoqing_kuqi/biaoqing_kuqi.png',
    //
    // sp_biaoqing_shengqi_json: chat.resPath + 'biaoqing/biaoqing_shengqi/biaoqing_shengqi.json',
    // sp_biaoqing_shengqi_atlas: chat.resPath + 'biaoqing/biaoqing_shengqi/biaoqing_shengqi.atlas',
    // sp_biaoqing_shengqi_png: chat.resPath + 'biaoqing/biaoqing_shengqi/biaoqing_shengqi.png',
    //
    // sp_biaoqing_tuxue_json: chat.resPath + 'biaoqing/biaoqing_tuxue/biaoqing_tuxue.json',
    // sp_biaoqing_tuxue_atlas: chat.resPath + 'biaoqing/biaoqing_tuxue/biaoqing_tuxue.atlas',
    // sp_biaoqing_tuxue_png: chat.resPath + 'biaoqing/biaoqing_tuxue/biaoqing_tuxue.png',
    //
    // sp_biaoqing_zhuanqian_json: chat.resPath + 'biaoqing/biaoqing_zhuanqian/biaoqing_zhuanqian.json',
    // sp_biaoqing_zhuanqian_atlas: chat.resPath + 'biaoqing/biaoqing_zhuanqian/biaoqing_zhuanqian.atlas',
    // sp_biaoqing_zhuanqian_png: chat.resPath + 'biaoqing/biaoqing_zhuanqian/biaoqing_zhuanqian.png',
    /**
     * 音效
     */
    vqifu: chat.resPath + "sound/prop/dajidali.mp3",
    vJiatelin: chat.resPath + "sound/prop/audio_jiatelin.mp3",
    vbomb: chat.resPath + "sound/prop/audio_bomb.mp3",
    vzan: chat.resPath + "sound/prop/audio_zan.mp3",
    vflower: chat.resPath + "sound/prop/audio_flower.mp3",
    vegg: chat.resPath + "sound/prop/audio_egg.mp3",
    vshoe: chat.resPath + "sound/prop/audio_shoe.mp3",
    vjiatelin: chat.resPath + "sound/prop/audio_jiatelin.mp3",
    vdapao: chat.resPath + "sound/prop/audio_dapao.mp3",
    vgongjian: chat.resPath + "sound/prop/audio_gongjian.mp3",
    vzhayao: chat.resPath + "sound/prop/audio_bomb.mp3",
    vchuizhuozi: chat.resPath + "sound/prop/audio_chuizhuozi.mp3",
    vbingtong: chat.resPath + "sound/prop/audio_bingtong.mp3",
    vche: chat.resPath + "sound/prop/audio_che.mp3",
    vplane: chat.resPath + "sound/prop/audio_plane.mp3",
    vship: chat.resPath + "sound/prop/audio_ship.mp3",

    hd_bingtong01_mp3:chat.resPath + "sound/hudong/hd_bingtong01.mp3",
    hd_daocha01_mp3:chat.resPath + "sound/hudong/hd_daocha01.mp3",
    hd_dapao01_mp3:chat.resPath + "sound/hudong/hd_dapao01.mp3",
    hd_dapao01_end_mp3:chat.resPath + "sound/hudong/hd_dapao01_end.mp3",
    hd_ganbei01_mp3:chat.resPath + "sound/hudong/hd_ganbei01.mp3",
    hd_gongjian01_mp3:chat.resPath + "sound/hudong/hd_gongjian01.mp3",
    hd_gongjian01_end_mp3:chat.resPath + "sound/hudong/hd_gongjian01_end.mp3",
    hd_jidan01_mp3:chat.resPath + "sound/hudong/hd_jidan01.mp3",
    hd_jiguanqiang01_mp3:chat.resPath + "sound/hudong/hd_jiguanqiang01.mp3",
    hd_maobi01_mp3:chat.resPath + "sound/hudong/hd_maobi01.mp3",
    hd_meigui01_mp3:chat.resPath + "sound/hudong/hd_meigui01.mp3",
    hd_woshou01_mp3:chat.resPath + "sound/hudong/hd_woshou01.mp3",
    hd_xianbing01_mp3:chat.resPath + "sound/hudong/hd_xianbing01.mp3",
    hd_zhuaji01_mp3:chat.resPath + "sound/hudong/hd_zhuaji01.mp3",

    qf_allmoneygomyhome01_mp3:chat.resPath + "sound/biaoqing/qf_allmoneygomyhome01.mp3",
    qf_baiyibai01_mp3:chat.resPath + "sound/biaoqing/qf_baiyibai01.mp3",
    qf_caishen01_mp3:chat.resPath + "sound/biaoqing/qf_caishen01.mp3",
    qf_dajidali01_mp3:chat.resPath + "sound/biaoqing/qf_dajidali01.mp3",


};
/**
 * 普通话
 */
for (var i = 1; i <= 10; i++) {
    chat.res['vv' + i + '_1'] = chat.resPath + "sound/man/v" + i + ".mp3";
    chat.res['vv' + i + '_2'] = chat.resPath + "sound/woman/v" + i + ".mp3";
}
var dialect_res = dialect_res || {};
/**
 * 长沙话
 */
// for (var i = 1; i <= 6; i++) {
//     for (var j = 0; j < 4; j++) {
//         chat.res['vcsv' + i + "_" + j + '_1'] = chat.resPath + 'changsha/man/' + 'v' + i + '_' + j + ".mp3";
//         chat.res['vcsv' + i + "_" + j + '_2'] = chat.resPath + 'changsha/woman/' + 'v' + i + '_' + j + ".mp3";
//
//         dialect_res['vcsv' + i + "_" + j + '_1'] = chat.resPath + 'changsha/man/' + 'v' + i + '_' + j + ".mp3";
//         dialect_res['vcsv' + i + "_" + j + '_2'] = chat.resPath + 'changsha/woman/' + 'v' + i + '_' + j + ".mp3";
//     }
// };
/**
 * 湖南话
 */
for (var i = 1; i <= 9; i++) {
    for (var j = 0; j < 1; j++) {
        chat.res['vcsv' + i + "_" + j + '_1'] = chat.resPath + 'sound/hunan/man/' + 'v' + i + '_' + j + ".mp3";
        chat.res['vcsv' + i + "_" + j + '_2'] = chat.resPath + 'sound/hunan/woman/' + 'v' + i + '_' + j + ".mp3";

        dialect_res['vcsv' + i + "_" + j + '_1'] = chat.resPath + 'sound/hunan/man/' + 'v' + i + '_' + j + ".mp3";
        dialect_res['vcsv' + i + "_" + j + '_2'] = chat.resPath + 'sound/hunan/woman/' + 'v' + i + '_' + j + ".mp3";
    }
}
/**
 * 新表情
 */
chat.NewProp = chat.resPath + 'xin/';
chat.biaoqingPath= chat.NewProp + 'biaoqing/';
chat.biaoqing = [
    'lt_cs01_baobao01', 'lt_cs01_bukaixin01', 'lt_cs01_caishendao01','lt_cs01_fahongbao01',
    'lt_cs01_fahuo01','lt_cs01_gongxifacai01','lt_cs01_gongxifacai02','lt_cs01_kanxi01','lt_cs01_nizou01',
    'lt_cs01_qiekenao01','lt_cs01_youqianrenxing01','lt_cs01_yun01',
    'qf_allmoneygomyhome01','qf_baiyibai01','qf_caishen01','qf_dajidali01'
];

for (var i = 0; i < chat.biaoqing.length; i++) {
    chat.res['sp_' + chat.biaoqing[i] + '_json'] = chat.biaoqingPath + chat.biaoqing[i] + '/' + chat.biaoqing[i] + '.json';
    chat.res['sp_' + chat.biaoqing[i] + '_atlas'] = chat.biaoqingPath + chat.biaoqing[i] + '/' + chat.biaoqing[i] + '.atlas';
    chat.res['sp_' + chat.biaoqing[i] + '_png'] = chat.biaoqingPath + chat.biaoqing[i] + '/' + chat.biaoqing[i] + '.png';
}

chat.hudongPath= chat.NewProp + 'hudong/';
chat.hudong = [
    'hd_bingtong01','hd_daocha01','hd_dapao01','hd_dapao01_end','hd_ganbei01','hd_gongjian01','hd_gongjian01_end',
    'hd_jidan01','hd_jiguanqiang01','hd_jiguanqiang01_end','hd_maobi01','hd_meigui01','hd_woshou01','hd_xianbing01',
    'hd_zhuaji01'
];

for (var i = 0; i < chat.hudong.length; i++) {
    chat.res['sp_' + chat.hudong[i] + '_json'] = chat.hudongPath + chat.hudong[i] + '/' + chat.hudong[i] + '.json';
    chat.res['sp_' + chat.hudong[i] + '_atlas'] = chat.hudongPath + chat.hudong[i] + '/' + chat.hudong[i] + '.atlas';
    chat.res['sp_' + chat.hudong[i] + '_png'] = chat.hudongPath + chat.hudong[i] + '/' + chat.hudong[i] + '.png';
    if(chat.hudong[i] == 'hd_jiguanqiang01_end'){
        chat.res['dankong_png'] = chat.hudongPath + chat.hudong[i] + '/' + 'dk.png';
        chat.res['zidan_png'] = chat.hudongPath + chat.hudong[i] + '/' + 'zidan.png';
    }
}
